# encoding=utf8
import sys
from JT_8103 import JT_8103
reload(sys)
sys.setdefaultencoding('utf8')

my_class=JT_8103()
class JT_8106:
    result = []
    analysisDescription=['参数总数：','参数列表：']
    par_list=my_class.par_list
    def LogicAisle(self, protocolStr, header):
        par_total=int(protocolStr[0:2],16)
        header.append(self.analysisDescription[0]+str(par_total)+"\n")
        header.append(self.analysisDescription[1]+"\n")
        par_id_list=protocolStr[2:]
        count=0
        find=False
        for i in range(par_total):
            par_id=par_id_list[count:count+8]
            print(par_id)
            for par in self.par_list:
                if "0000"+par['id']==par_id.upper():
                    par_des = par['des']
                    header.append(par_id+" "+par_des+"\n")
                    find=True
                    break
            if find==False:
                header.append(par_id+"\n")
            count +=8          
        self.result=header
